package com.young.springdemo.service.observerPattern;

public class ConcreateAlly extends AllyControllerCenter {

    public ConcreateAlly(String name) {
        this.name = name;
    }

    @Override
    public void notify(String name) {
        System.out.println(this.name + "站队受到攻击," + name + "来帮忙了...");
        for (Observer observer : this.players) {
            if (!observer.getName().equalsIgnoreCase(name))
                observer.help();
        }
    }
}
